/*
 * @Author: huCheng Li
 * @Date: 2023-10-21 15:13:38
 * @description:
 * @LastEditTime: 2023-10-27 17:11:48
 * @FilePath: \三阶段项目\pili-pili-app\src\apis\userApis.ts
 */

// import { Token } from "typescript";
import { AUTO_LOGIN_URL,  USER_LOGIN_URL, USER_PWD_LOGIN_URL, USER_VDT_CODE_URL, VIDEOS_URL } from "../config/urls.cfg";
import request from "./ajax";

// 获取验证码接口
export function getVdtCodeApi(phone: number): Promise<any> {
  return request({
    url: USER_VDT_CODE_URL,
    method: 'POST',
    data: {
      phone: phone + ''
    }
  })

}
//验证码登录接口
export function userLoginApi(phone: string, code: string): Promise<any> {

  return request({
    url: USER_LOGIN_URL,
    method: 'POST',
    data: {
      phone: phone,
      code: code
    }
  })
}
//密码登录接口
export function usePsdApi(id: string, password: string): Promise<any> {

  return request({
    url: USER_PWD_LOGIN_URL,
    method: 'POST',
    data: {
      id: id,
      password: password
    }
  })
}
//免登录接口
export function autoLoginApi(): Promise<any> {
  return request({ url: AUTO_LOGIN_URL, method: 'POST' })
}

//视频接口
export function videosApi() {
  return request({ url: VIDEOS_URL })
}

// //自动登录获取头像接口

// export function headhApi(token) {
//   return request({ url: HEAD_URL,
//     method:'POST',
//     params:token
//   })
// }